li = [1, 2, 3, 4]
cnt = 0
for n1 in li:
    for n2 in li:
        for n3 in li:
            num = 0
            num += n1
            num *= 10
            num += n2
            num *= 10
            num += n3
            print(num)
            cnt += 1
print('共有', cnt, '种组合')